import optparse
import nmap

parser = optparse.OptionParser(
    usage="usage:%prog -H <target host> -P <target ports, seperated by comma")
parser.add_option("-H", dest="targetHost", type="string", help="target host")
parser.add_option("-P", dest="targetPorts",
                  type="string", help="target ports list")


def nmap_scann():
    scanner = nmap.PortScanner()
    pass


if __name__ == "__main__":
    options, args = parser.parse_args()
    if not options.targetHost or not options.targetPorts:
        print(parser.usage)
        exit(-1)

    targetHost = options.targetHost
    targetPorts = options.targetPorts
    targetPorts = targetHost.split(",")
    for targetPort in targetPorts:
        pass
